﻿// This file is part of Code4Public (http://code4public.codeplex.com)
// Copyright 2011 Sina Iravanian - <sina@sinairv.com>
//
// This source file(s) may be redistributed, altered and customized
// by any means PROVIDING the authors name and all copyright
// notices remain intact.
// THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED. USE IT AT YOUR OWN RISK. THE AUTHOR ACCEPTS NO
// LIABILITY FOR ANY DATA DAMAGE/LOSS THAT THIS PRODUCT MAY CAUSE.
// ------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Code4Public.Settings;

namespace Code4Public
{
    public class CodeConstants
    {
        public class XMLStructForLanguages
        {
            static XMLStructForLanguages()
            {
                // TODO: Load readonly values from config file to override their hard-coded value provided below
                // Root = "Salam";
            }

            public static readonly string Root = "root";
            public static readonly string Language = "Language";
            public static readonly string AttrLanguageName = "name";
            public static readonly string AttrLanguageCaseSensitive = "casesensitive";
            public static readonly string Keywords = "Keywords";
            public static readonly string String = "String";
            public static readonly string AttrStringStartsWith = "startswith";
            public static readonly string AttrStringEndsWith   = "endswith";
            public static readonly string AttrStringEscape     = "escape";
            public static readonly string CommentLine = "CommentLine";
            public static readonly string AttrCommentLineStartsWith = "startswith";
            public static readonly string Comment = "Comment";
            public static readonly string AttrCommentStartsWith = "startswith";
            public static readonly string AttrCommentEndsWith   = "endswith";
            public static readonly string CustomWordGroup = "CustomWordGroup";
            public static readonly string AttrCustomWordGroupColorGroup = "colorgroup";
            public static readonly string CustomDelimited = "CustomDelimited";
            public static readonly string AttrCustomDelimitedStartsWith = "startswith";
            public static readonly string AttrCustomDelimitedEndsWith   = "endswith";
            public static readonly string AttrCustomDelimitedColorGroup = "colorgroup";
        }

        public class XMLStructForColorProfiles
        {
            static XMLStructForColorProfiles()
            {
                // TODO: Load readonly values from config file to override their hard-coded value provided below
                // Root = "Salam";
            }

            public static readonly string Root = "root";
            public static readonly string ColorProfile = "ColorProfile";
            public static readonly string AttrColorProfileName = "name";
            public static readonly string Assignment = "Assignment";
            public static readonly string AttrAssignmentName = "name";
            public static readonly string AttrAssignmentColor = "color";
            public static readonly string AttrAssignmentBold = "bold";
            public static readonly string AttrAssignmentItalic = "italic";

        }

        public class XMLStructForThemes
        {
            static XMLStructForThemes()
            {
                // TODO: Load readonly values from config file to override their hard-coded value provided below
                // Root = "Salam";
            }

            public static readonly string Root = "root";
            public static readonly string Theme = "Theme";
            public static readonly string AttrThemeName = "name";
            public static readonly string Header = "Header";
            public static readonly string Border = "Border";
            public static readonly string AttrBorderTop = "top";
            public static readonly string AttrBorderBottom = "bottom";
            public static readonly string AttrBorderLeft = "left";
            public static readonly string AttrBorderRight = "right";
            public static readonly string AttrBorderColor = "color";
            public static readonly string Font = "Font";
            public static readonly string AttrFontBold = "bold";
            public static readonly string AttrFontItalic = "italic";
            public static readonly string AttrFontColor = "color";
            public static readonly string BackColor = "BackColor";
            public static readonly string AttrBackColorValue = "value";
            public static readonly string MainContent = "MainContent";
            public static readonly string FontSize = "FontSize";
            public static readonly string AttrFontSizeValue = "value";
            public static readonly string LineNumbers = "LineNumbers";
            public static readonly string SeperatorLine = "SeperatorLine";
            public static readonly string AttrSeperatorLineShow = "show";
            public static readonly string AttrSeperatorLineColor = "color";
            public static readonly string ShowZeros = "ShowZeros";
            public static readonly string AttrShowZerosValue = "value";
            public static readonly string CodeContent = "CodeContent";

            public static readonly string SpacesBefore = "SpacesBefore";
            public static readonly string AttrSpacesBeforeCount = "count";
            public static readonly string SpacesAfter = "SpacesAfter";
            public static readonly string AttrSpacesAfterCount = "count";
            public static readonly string CharAfterLineNo = "CharAfterLineNo";
            public static readonly string AttrCharAfterLineNoShow = "show";
            public static readonly string AttrCharAfterLineNoValue = "value";


        }

        public class XMLStructForAppSettings
        {
            static XMLStructForAppSettings()
            {
                // TODO: Load readonly values from config file to override their hard-coded value provided below
                // Root = "Salam";
            }

            public static readonly string Root = "root";
            public static readonly string LanguagesFile = "LanguagesFile";
            public static readonly string AttrLanguagesFilePath = "path";
            public static readonly string ColorProfilesFile = "ColorProfilesFile";
            public static readonly string AttrColorProfilesFilePath = "path";
            public static readonly string CodeConstantsFile = "CodeConstantsFile";
            public static readonly string AttrCodeConstantsFilePath = "path";
            public static readonly string ThemesFile = "ThemesFile";
            public static readonly string AttrThemesFilePath = "path";
            public static readonly string DefaultColorProfile = "DefaultColorProfile";
            public static readonly string AttrDefaultColorProfileName = "name";
            public static readonly string DefaultTheme = "DefaultTheme";
            public static readonly string AttrDefaultThemeName = "name";
            public static readonly string TabSize = "TabSize";
            public static readonly string AttrTabSizeValue = "value";
            public static readonly string ReplaceTabs = "ReplaceTabs";
            public static readonly string AttrReplaceTabsValue = "value";
            public static readonly string DefaultTextColor = "DefaultTextColor";
            public static readonly string AttrDefaultTextColorValue = "value";
            public static readonly string DefaultLanguageName = "DefaultLanguageName";
            public static readonly string AttrDefaultLanguageNameName = "name";

        }

        public class ColorProfile
        {
            static ColorProfile()
            {
                // TODO: Load readonly values from config file to override their hard-coded value provided below
                // Root = "Salam";
            }
            public static readonly string GroupNameDefault      = "default";
            public static readonly string GroupNameNumbers      = "number";
            public static readonly string GroupNameOperators    = "operator";
            public static readonly string GroupNameKeywords     = "keyword";
            public static readonly string GroupNameStrings      = "string";
            public static readonly string GroupNameCommentLines = "comment-line";
            public static readonly string GroupNameComments     = "comment";


        }

        public class Theme
        {
            static Theme()
            {
                // TODO: Load readonly values from config file to override their hard-coded value provided below
                // Root = "Salam";
            }

            public static readonly BorderInfo HeaderBorderDefault = 
                new BorderInfo { Bottom=false, Left=false, Right=false, Top=true, Color=Color.Black };
            
            public static readonly FontInfo HeaderFontDefault = 
                new FontInfo { Bold = true, Italic=false, Color= Color.Black };
            
            public static readonly Color HeaderBackColorDefault = Color.White;

            public static readonly int HeaderFontSizeDefault = 9;

            public static readonly BorderInfo MainContentBorderDefault =  
                new BorderInfo {Bottom=true, Left=false, Right=false, Top=true, Color=Color.Black};
            public static readonly int MainContentFontSizeDefault = 9;

            public static readonly bool LineNumbersShowSeperatorLineDefault = true;
            public static readonly Color LineNumbersSeperatorLineColorDefault = Color.Black;
            public static readonly FontInfo LineNumbersFontDefault = 
                new FontInfo { Bold = false, Italic = false, Color = Color.Blue};
 
            public static readonly Color LineNumbersBackColorDefault = Color.White;
            public static readonly bool LineNumbersShowZerosDefault = false;
            public static readonly bool LineNumbersShowStringAfterDefault = false;
            public static readonly string LineNumbersStringAfterDefault = ":";
            public static readonly int LineNumbersSpacesAfterDefault = 0;
            public static readonly int LineNumbersSpacesBeforeDefault = 1;

            public static readonly Color CodeContentBackColorDefault = Color.White;
            public static readonly FontInfo CodeContentFontDefault =
                new FontInfo { Bold = false, Italic = false, Color = Color.Black };
        }

        public class GUI
        {
            static GUI()
            {
                // TODO: Load readonly values from config file to override their hard-coded value provided below
            }

            // this is the name in the languages list submenus, 
            // that is active when there are no languages selected.
            public static readonly string CopyPasteModeCaption = "(Copy-Paste Mode)";
            public static readonly string NoHighlightingModeCaption = "(No Highlighting)";
            public static readonly string PlainHTMLThemeCaption = "(No Themes)";

            public static readonly Color ShowButtionsActiveColor = Color.LightGray;
            public static readonly Color ShowButtionsDeactiveColor = Color.White;

            public static readonly int ThemePreviewDefaultInternalPadding = 20;
            public static readonly string ThemePreviewDefaultUntitledName = "(untitled theme)";
            public static readonly string ThemePreviewHeaderCaption = "Header Caption";
            public static readonly string ThemePreviewSampleCodeLine = "    some code   ";
            public static readonly string ThemePreviewFontFace = "Courier New";
            public static readonly int ThemePreviewDotLinesCount = 3;
        }

        public class Configs
        {
            static Configs()
            {
                // TODO: Load readonly values from config file to override their hard-coded value provided below
                // Root = "Salam";
            }

            /// <summary>
            /// Do not change this path; the path to the App-Settings file is really hard-coded.
            /// </summary>
            public static readonly string AppSettingsPath = "./ConfigFiles/AppSettings.xml";

            public static readonly string DefaultLanguagesPath = "./ConfigFiles/Languages.xml";
            public static readonly string DefaultColorProfilesPath = "./ConfigFiles/ColorProfiles.xml";
            public static readonly string DefaultCodeConstantsPath = "./ConfigFiles/CodeConstants.xml";
            public static readonly string DefaultThemesPath = "./ConfigFiles/Themes.xml";

            public static readonly bool DefaultReplaceTabs = true;
            public static readonly int DefaultTabSize = 4;
            public static readonly Color DefaultTextColor = Color.Black;
            public static readonly string DefaultLanguageName = "";

            public static readonly string ApplicationName = "Code4Public";
        }

        public class HTML
        {
            static HTML()
            {
                // TODO: load
            }

            public static readonly string LineNumbersHolderText = "{LINENUMBERS}";
            public static readonly string CodeContentHolderText = "{CODECONTENT}";
//            public static readonly int CharWidthEstimate = 10; // pixels
            public static readonly string Space = " ";

            public static readonly string StyleNamePrefix = "C4P";

            public static readonly string StyleNameMainContentTable = "MainContentTable";
            public static readonly string StyleNameCodeContentTD = "CodeContentTD";
            public static readonly string StyleNameLineNumbersTD = "LineNumbersTD";
            public static readonly string StyleNameHeaderDiv = "HeaderDiv";
            public static readonly string StyleNameHeaderTable = "HeaderTable";
            public static readonly string StyleNameCodeDefaultColor = "CodeDefaultColor";

            public static readonly string StyleCodeColorPrefixMain = "CodeColor_";
            public static readonly string StyleNameCodeColorPrefix = StyleNamePrefix + StyleCodeColorPrefixMain;
        }
    }
}
